﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WowTourGuideTranslator
{
    /// <summary>
    /// base class for tourguide exceptions
    /// </summary>
    abstract class TourGuideBaseTranslatorException : ApplicationException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TourGuideBaseTranslatorException"/> class.
        /// </summary>
        public TourGuideBaseTranslatorException()
            : base()
        {

        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TourGuideBaseTranslatorException"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        public TourGuideBaseTranslatorException(string message)
            : base(message)
        {

        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TourGuideBaseTranslatorException"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="innerException">The inner exception.</param>
        public TourGuideBaseTranslatorException(string message, Exception innerException)
            : base(message, innerException)
        {

        }
    }

    /// <summary>
    /// Exception for canceling the tour guide processing
    /// </summary>
    class TourGuideCancelationException : TourGuideBaseTranslatorException
    {

    }

    /// <summary>
    /// Exception for failed downloads
    /// </summary>
    class TourGuideDownloadException : TourGuideBaseTranslatorException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TourGuideDownloadException"/> class.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <param name="inner">The inner exception.</param>
        public TourGuideDownloadException(string url, Exception inner)
            : base(string.Format("Error while downloading from \"{0}\"!", url), inner)
        {
        }
    }
}
